package com.ysq.www.common.exception;


import com.ysq.www.common.result.ResultStatusCode;

public class BaseException extends RuntimeException {

    private Integer code;

    private String errorMsg;


    public BaseException(){
        super();
    }

    public BaseException(String message, Throwable cause) {
        super(message, cause);
    }

    public BaseException(Integer code,String message) {
        super(message);
        this.setCode(code);
    }

    public BaseException(ResultStatusCode statusCode) {
        super(statusCode.getMsg());
        this.setCode(statusCode.getCode());
    }

    public BaseException(Throwable cause) {
        super(cause);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
